//
//  ComposeTitleView.swift
//  WB
//
//  Created by leador on 17/5/12.
//  Copyright © 2017年 袁满. All rights reserved.
//

import UIKit
import SnapKit

class ComposeTitleView: UIView {
    
    lazy var titleLabel : UILabel = UILabel()
    
    lazy var screenNameLabel : UILabel = UILabel()

    override init(frame: CGRect) {
        
        super.init(frame: frame)
        
        setupUI()
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

}

//MARK: ---设置UI界面---
extension ComposeTitleView {
    
    func setupUI() {
        
        addSubview(titleLabel)
        addSubview(screenNameLabel)

        titleLabel.snp.updateConstraints { (make) in
            
            make.centerX.equalTo(self)
            make.top.equalTo(self)
            
        }
        
        screenNameLabel.snp.updateConstraints { (make) in
            
            make.centerX.equalTo(self)
            make.bottom.equalTo(self).offset(3)
        }
        
        titleLabel.font =  UIFont.systemFont(ofSize: 16)
        screenNameLabel.font = UIFont.systemFont(ofSize: 14)
        screenNameLabel.textColor = UIColor.lightGray
        
        titleLabel.text = "发微博"
        screenNameLabel.text = UserAccountViewModel.shareInstance.account?.name
        
    }
    
}
